package com.yang.util;

import java.util.UUID;

/**
 * @Author 杨天可
 * @Date 2021/3/9 16:25
 * @Version 1.0
 */
public class NumberGeneration {
    /***
     * 合同编号生成
     */
    public String contractNumber() {
        return UUID.randomUUID().toString().replace("-", "").toUpperCase();
    }


    /***
     * 工号生成  部门编号+电话中间四位
     */
    public String jobNumber(Integer departmentId, String phoneNumber) {
        String result = "";
        String subPhone = phoneNumber.substring(4, 8);
        switch (departmentId) {
            case 1: {
                result = Constants.SENIOR+"-" + subPhone;
                break;
            }
            case 2: {
                result = Constants.CHECK + "-" + subPhone;
                break;
            }
            case 3: {
                result = Constants.DESIGN + "-" + subPhone;
                break;
            }
            case 4: {
                result = Constants.OPERATE + "-" + subPhone;
                break;
            }
            case 5: {
                result = Constants.PERSONNEL + "-" + subPhone;
                break;
            }
            case 6: {
                result = Constants.DEVELOPMENT + "-" + subPhone;
                break;
            }

        }
        return result;
    }

}
